package com.example.test.controller;

import com.example.test.bean.UserBean;
import com.example.test.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.management.modelmbean.ModelMBean;
import java.util.List;

@Controller
public class UserController {

    @Resource
    UserService userService;

    @RequestMapping("/users")
    public String showUsers(ModelMap modelMap){
        List<UserBean>userBeanList = userService.getAllUser();
        modelMap.addAttribute("userList",userList);
        return "users";
    }
}
